|
|
 |
|
|
|
|
' X = Width
' Y = Height
lblXY = .Width & "/" & .Height
' Calculate Pixel Width/Height of Monitor
lblTwips = .TwipsPerPixelX & "/" & .TwipsPerPixelY
' Calculate the resolution of the screen
lblRes = .Width / .TwipsPerPixelX & "/" & _
.Height / .TwipsPerPixelY
End With
End Sub |
|
|
|
|
|
|
|
|
On a screen running in 800 × 600 resolution, you should see that the Width and Height properties are 12000 and 9000, respectively. The value 12000 is the number of twips for the horizontal axis (X), and the value 9000 is the number of twips for the vertical axis (Y). The amount of twips per pixel for the X axis is 15, and the amount of twips per pixel for the Y axis is also 15. Dividing the Width property by the TwipsPerPixelX property gives you the horizontal resolution of your screen. Dividing the Height property by the TwipsPerPixelY property gives you the vertical resolution of your screen. |
|
|
|
|
|
|
|
|
You have many available fonts to choose from in the Windows environment. There are also several third-party add-on fonts you can purchase. If you want to give the user a choice of fonts he or she can use in your system, you need to enable the user to retrieve this list from the Windows environment. |
|
|
|
|
|
|
|
|
Using the Screen object, you can query this list of font names in the system. The following code shows how to retrieve the available screen fonts in your system: |
|
|
|
 |
|
|
|
|
Private Sub cmdFonts_Click()
Dim intLoop As Integer
With Screen
' Display Font Count
lblFontCount = .FontCount
' Load list box with all screen fonts
lstFonts.Clear |
|
|
|
|
|